﻿@page
@model LoginModel
@{
    ViewData["Title"] = "用户登录";
    Layout = "_Global";
}

<main>
    <div class="card shadow mb-0">
        <div class="card-body px-md-5 py-5">
            <div class="mb-3">
                <h6 class="h3">@ViewBag.Title</h6>
                @if (string.IsNullOrEmpty(Model.ErrorMessage))
                {
                    <p class="text-muted mb-0">通过账户登录网站！</p>
                }
                else
                {
                    <p class="text-danger mb-0">@Model.ErrorMessage</p>
                }
            </div>
            <span class="clearfix"></span>
            <form role="form" method="post" asp-route-returnUrl="@Model.ReturnUrl">
                <div class="form-group mb-2">
                    <label class="form-control-label mb-1">账户名称</label>
                    <div class="input-group-prepend">
                        <label><i class="bi-person"></i></label>
                        <input type="text" asp-for="Input.UserName" class="form-control" placeholder="请输入账户名称">
                    </div>
                    <span class="text-danger" asp-validation-for="Input.UserName"></span>
                </div>
                <div class="form-group mb-2">
                    <label class="form-control-label mb-1">密码</label>
                    <div class="input-group-prepend">
                        <label><i class="bi-key"></i></label>
                        <input type="password" asp-for="Input.Password" class="form-control" placeholder="请输入密码">
                    </div>
                    <span class="text-danger" asp-validation-for="Input.Password"></span>
                </div>
                <div class="form-group mb-2" .visible="@Model.Settings.ValidCode">
                    <label class="form-control-label mb-1">验证码</label>
                    <div class="input-group-prepend input-group-append">
                        <label><i class="bi-lock"></i></label>
                        <input type="text" asp-for="Input.Code" class="form-control verifier-input" placeholder="请输入验证码">
                        <gt:verifier key="login"></gt:verifier>
                    </div>
                    <span class="text-danger" asp-validation-for="Input.Code"></span>
                </div>
                <div class="mt-4">
                    <button type="submit" class="btn btn-sm btn-primary btn-icon rounded-pill">
                        <span class="btn-inner-text"> 登录 </span>
                        <span class="btn-inner-icon"><i class="bi-arrow-right"></i></span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</main>
